package com.bw.paper.mvp.view.Fragment.Live.adapter;


import android.widget.ImageView;
import android.widget.TextView;

import com.bw.paper.R;
import com.bw.paper.entity.LiveCommentEntity;
import com.bw.paper.network.LoadImage;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.tb.emoji.EmojiUtil;

import org.jetbrains.annotations.NotNull;

import java.io.IOException;

public class LiveCommentAdapter extends BaseQuickAdapter<LiveCommentEntity.Values, BaseViewHolder> {
    public LiveCommentAdapter() {
        super(R.layout.item_comment);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder, LiveCommentEntity.Values values) {
        baseViewHolder.setText(R.id.comment_item_fabulous_tv,"101");
        baseViewHolder.setText(R.id.comment_item_name_tv,""+values.user_name);
        baseViewHolder.setText(R.id.comment_item_time_tv,""+values.comment_time);
        baseViewHolder.setText(R.id.comment_item_address_tv,"天津");
        TextView comment_item_values_tv = baseViewHolder.getView(R.id.comment_item_values_tv);
        try {
            EmojiUtil.handlerEmojiText(comment_item_values_tv, values.comment_value, getContext());
        } catch (IOException e) {
            e.printStackTrace();
        }
        ImageView headImg = baseViewHolder.getView(R.id.comment_item_head_img);
        LoadImage.loadCircleImg(values.user_img,headImg);
    }
}